
package code.rocky.chapter10;

public class Suggest132 {
    public static void main(String[] args) {

    }

    public void demo01(int i, int count) {
        while (i < count * 2) {
            // do Something
        }
    }

    public void demo02(int i, int count) {
        int total = count * 2;
        while (i < total) {
            // do Something
        }
    }

    public String toChineseNum1(int num) {
        // 中文数字
        String[] cns = {"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
        return cns[num];
    }

    final static  String[] cns = {"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};;
    public String toChineseNum2(int num) {
        // 中文数字
        return cns[num];
    }

    public void demo03(int max) {
        String str = "Log file is ready";
        for (int i = 0; i < max; i++) {
            str += " log " + i;
        }
    }

    public void demo04(int max) {
        StringBuilder str = new StringBuilder(20000);
        str.append("Log file is ready");
        for (int i = 0; i < max; i++) {
            str.append(" log " + i);
        }
        String log = str.toString();
    }
}
